<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import = "Bean.User" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>updateUser</title>
</head>
<body>
	<% 
		boolean isOk = false;
		String username = request.getParameter("username");
		User user = (User)request.getSession().getAttribute("nowUser");
		String nowUsername = user.getUsername();
	%>
	<c:choose>
	<c:when test = "${ nowUsername == 'admin' }">
		<form action = "admin_info.jsp" method = "post"> 
			<input type = "submit" value = "返回" />
		</form>
	</c:when>
	<c:otherwise>
		<form action = "info.jsp" method = "post"> 
			<input type = "submit" value = "返回" />
		</form>
	</c:otherwise>
	</c:choose>
	<form action = "http://localhost:8083/Car_Pass_Count_System/updateUserServlet" method = "post">
		username:<input type = "text" value = "${ param.username }" name = "username" readonly = "readonly"/><br/>
		password:<input type = "password" name = "passwd"/><br/>
		new &nbsp; password:<input type = "password" name = "newPassword" /><br/>
		<input type = "submit" />
	</form>
	<c:if test = "${isOk}"> 更新成功 </c:if>
</body>
</html>